﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using mscook.core.domain;
using NHibernate.Linq;

namespace mscook.core.repositories
{
    public class MagazineLabelRepository:Repository<MagazineLabel>, mscook.core.repositories.IMagazineLabelRepository
    {
        public MagazineLabel GetByMagazineAndUser(string magazineId,string loginUserId)
        {
            return  (from x in this.Session.Query<MagazineLabel>() select x)
               .Where(o => o.IsDelete == false
                   &&o.MagazineId==magazineId
                   &&o.LoginUserId==loginUserId
               ).SingleOrDefault();
        }
    }
}
